{% extends "zylinder_app/skel.html" %}
{% load static %}

{% block addCSS %}
<link rel="stylesheet" href="{% static 'zylinder_app/style.css' %}">
{% endblock %}

{% block body %}
  <a href="{% url 'zylinder_app:main' %}">zurück</a>
  <h1>Your Transactions</h1>
    <table class="fixedTableLayout">
      <thead>
        <th scope="col">Aktie</th>
        <th scope="col">Kürzel</th>
        <th scope="col">Gekauft am</th>
        <th scope="col">Gekauft für</th>
        <th scope="col">Verkauft am</th>
        <th scope="col">Verkauft für</th>
      </thead>
      <tbody>
      {% for transaction in object_list %}
        <tr>
          <td>{{ transaction.symbol.description }}</td>
          <td>{{ transaction.symbol.symbol }}</td>
          <td>{{ transaction.buydate }}</td>
          <td>{{ transaction.boughtfor }}</td>
          {% if transaction.selldate %}
            <td>{{ transaction.selldate }}</td>
            <td>{{ transaction.soldfor }}</td>
          {% else %}
            <td>im Besitz</td>
            <td>im Besitz</td>
          {% endif %}
        </tr>
      {% empty %}
        <p>Noch wurden keine Aktien gekauft.</p>
      {% endfor %}
      </tbody>
    </table>
{% endblock %}

{% block addJS %}
{% endblock %}
